From described behavior it's sounds like you need to swap U & V phase leads of motor. This reverses motor rotating direction (drive must see encoder & motor rotating in sync, not in opposite directions).
About connection error EMI noise problem, it would be quite necessary to find a solution to this to be able to tune parameteres properly. Tips:
-Use shielded motor power cable and connect shield to drive GND
-Make sure motor frame is also connected to drive GND (via shield or ground lead inside cable)
-If still problems, you can try adding ferrite core noise suppression filter (or several of them) to USB cable & motor cable