How to make motors backswards spinning?

Once you know what your program needs to do, you can start to think about how you will achive it. This means writing some software to take sensor readings and respond to them, and designing the hardware to control the motors and make things happen.

You can use an h-bridge to control the direction of the motor. By using the PWM outputs, you can also change the speed of the motors.

There are several methods of checking the switch state. You could do it the simple way using digitalRead, you could use interrupts, or you could challenge yourself by trying to do it with port manipulation. In programming, there is (almost) always several methods of doing something.

H-bridges: http://itp.nyu.edu/physcomp/Labs/DCMotorControl
analogWrite (PWM): analogWrite() - Arduino Reference
digitalRead: http://arduino.cc/en/Reference/DigitalRead
port manipulation: Arduino Reference - Arduino Reference
interrupts: http://arduino.cc/en/Reference/AttachInterrupt

If I remember correctly, the first arduino program that I wrote was to do the same thing. My lack of knowledge at the time meant that I would have fried my arduino if I tried to make it work. Good job I did not test it! XD

Good luck!
Onions.