Just came across a few more tidbits (I've been trying to solve my own USB MIDI keyboard issues)...
- try unplugging all your USB devices except the MIDI keyboard, mouse and computer keyboard (if you're using USB mouse and computer keyboard)
- if your MIDI keyboard is plugged into a USB 3 slot, try it in a USB 2
- make sure you're using a reasonable quality USB cable
The solution for me was unplugging everything I wasn't using (printer, scanner, external drive).