A typical PWM circuit consist of a triangle wave generator followed by a comparator. By varying the compared voltage on the comparator, you'll make it a pmw output generator.
There are millions of sites on the web that show how to use pwm generated by for example 555-timer to control a speed of a dc motor ..
Here is just one example:
**broken link removed**
If you want to change direction on top of the speed control you have to use bridge configuration and switch the polarity of the voltage by, for example, relays, or mostets, or BJTs ..
See this example: **broken link removed**