Rockbox is an open source firmware replacement for many mp3 players, and they
apparently have a port in progress for the D2. Here is the info they have collected for it:
http://www.rockbox.org/twiki/bin/view/Main/CowonD2Info
If you dig around (maybe email some of the devs), you're sure to find out the tools they used to do this.
They will have created a custom bootloader from the original firmware in order to get Rockbox running (which is coded mostly in C). If you can figure that out, you could fork the bootloader to start running your own code. They are always looking for help if you're really interested. Rockbox is a great project.
If you are looking to code for the original firmware, then I'm sorry, I couldnt find any information about that. Cowon themselves might be a good place to ask.
If you're looking for a large community of Cowon D2 users, see here:
iAudiophile.net Cowon D2 forum
Hope this helps.