DIY Electronic Speed Controller for $15.00
Here is a well documented DIY tutorial on how to build a basic electronic speed controller. The article takes your through a ground up process on how to build the circuit as well as how to program the PIC that controls the speed controller. The article does indicate that the design does lack sophistication, but this is a good place to start. You could use this design as a learning