The driver itself is probably not even the hardest thing, provided you stick to ordinary black and white printing. Some people have already indicated there are many examples out there. The real problem is finding out which codes to send to the printer: these are almost never documented in the printer manuals anymore. At one time I wanted to write a driver for my HP LaserJet 6MP, only to find out that the manuals I needed would set me back about 200 €. You open up a can of worms if you want to create a colour printer driver: colour calibration is an extremely tricky subject, definitely not for the unwary and uninitiated.