If you can, try isolating the entire motor power supply from your control power supply. Then use opto-isolators for any control operations so that the circuits don't interfere with each other.
Tried one and two 0.1uF caps between the motor terminals, noticed some improvement but usb still stops working eventually..
Did you mean caps from the motor terminals to the ground as well? I don't have enough here to do that today :/
I'm getting suspicious of those pull-up 1k resistors between each input terminal and 5V, could they be providing a path for supply interference to affect the logic wires? I'm not even sure why those resistors are there, most L298N circuits don't have them at all.
The motor supply is already isolated: 2x16340 for motors and USB for the arduino - unless you mean using a third supply for the logic part of the H-bridge board. I only got this board because it was supposed to "just work". One or two caps are fine but if I have to add a lot or even opto-isolators it's certainly not worth the trouble...
Edit:
As a side note this motor is one of those very small radio controlled toy car's.
All the interference is gone if I wire a diode in series with the motor but then I obviously lose the other direction..
The pull up resistors are there to make sure the inputs
are pulled to one side of the supply and are not floating
if no connection to the inputs are made.
Pull up resistors are not your problem. It is the motors
or the motor wiring that seems to be introducing too
much noise.
Try to isolate the motors using Opto Isolators like BB
mentioned or find less noisy motors and/or use shielded
wire to connect the motors.
An oscilloscope would come in handy right about now..
Have you tried physically moving the motor away from the setup a bit? It may also be producing large amounts of RF interference.
As for the capacitor suggestion I had earlier, you'll see this very often in cheap devices that contain brushed motors and also microcontrollers, such as kids toys.
Unfortunately a scope is completely out of question but thanks for clearing up on the resistors.
Moving the motor away seems quite obvious but as a matter of fact I haven't tried it yet... I'll try that tomorrow!
Edit: Haven't played much with it lately but I'm quite confident that the main problem is that other peripherals are being inducted. I had an electro magnet crash the keyboard the other day and the EM wans't even plugged to the computer...