I had problems with the xbox 360 controller too. The following solved it.
Edit the file
/opt/retropie/emulators/RetroArch/configs/XboxGamepad(userspacedriver).cfg
Look for the following lines
input_up_axis = "+5"
input_down_axis = "-5"
input_left_axis = "+6"
input_right_axis = "-6"
Edit them to look like this if you want to use the d-pad
input_up_btn = "h0up"
input_down_btn = "h0down"
input_left_btn = "h0left"
input_right_btn = "h0right"
Or Edit them like this to use the left stick
input_up_axis = "+0"
input_down_axis = "-0"
input_left_axis = "+1"
input_right_axis = "-1"