As far as I know, there are already drivers for pendrives. You can play around anyway; you will learn an awful lot if you can understand the pendrive drivers because you will have to deal with the USB bus driver, the storage device driver, etc. You're looking at understanding 4, possibly more drivers if you try to understand the USB pendrive driver.
For a start, read the book "Linux Device Drivers 3rd edition" by Rubini, Corbet, et al. They explain the basics fairly well and introduce you to various tricks used by driver writers (and explain how the tricks work). Have a look at some simple drivers like the 'watchdog' drivers. When you're a bit more daring, have a look at the serial port (UART) drivers - that gets more complicated because of the various layers such as the 'discipline' (essentially a filter), and the tty code. That code is still reasonably 'simple' - when you're confident you've understood that, then you can have a look at the 'usb_storage' code. If you can understand that code then you'll know your way around the device driver tree fairly well; you'll still only know a fairly small amount about the overall scheme, but from that point you can proceed to play with any driver with a reasonable degree of confidence.