You can map your controller pcb to a virtual keyboad device using the built-in xboxdrv.
Keyboard Emulation
The following configuration will cause xboxdrv to emulate a keyboard, which can be useful for games that are played with keyboard, like Flash games or games that don't support a joystick. Since different games use different keyboard keys you might have to adjust the keybindings to fit the game:
$ xboxdrv
--ui-clear
--ui-buttonmap a=XK_a,b=XK_b,x=XK_x,y=XK_y
--ui-buttonmap dl=XK_Left,dr=XK_Right,du=XK_Up,dd=XK_Down
Taken from:
http://pingus.seul.org/~grumbel/xboxdrv/xboxdrv.html
There is also "Linux Joystick Mapper" that is very similar and a good choice as well. It's not included with RetroPie, so you'll have to make and install it.