Here's an easy way: install the Bitlash interpreter on your Arduino (http://bitlash.net). Upload the Bitlashdemo sketch. Then your problem comes down to defining a function in Bitlash to go clockwise, and another to go counterclockwise (ccw). You can copy and paste these into Bitlash in the serial monitor:
// pwm motor controls
//
function startup { pinmode(6,1); pinmode(7,1); pinmode(8,1); }
function gocw { d7=1; d8=1; a6=255; }
function goccw { d7=0; d8=0; a6=100; }
Then when you type "gocw" it will call the gocw function to make the motor go clockwise, and likewise with "goccw". I'm guessing you'll also need a function named "stop"...
-br
Edit: Once that's working, to set the rpm, change the functions to look like this:
function gocw { d7=1; d8=1; a6=arg(1); }
function goccw { d7=0; d8=0; a6=arg(1); }
And you can type "gocw(237)" or "goccw(10)". So maybe stop is just gocw(0)?