Can someone put some PWM motor control samples in the IDE?

Thanks for your replies, for a normal DC motor I had assumed than the best method would be to swing one terminal high or low to control direction and apply a direction compensated PWM signal to the other terminal, this seems to work OK but I couldn't find any example. I was not suggesting connecting the motor directly to an Arduino, I have a simple driver chip isolating my motors.