If you go to:
http://calibre.kovidgoyal.net/wiki/Development
it tells you what you need to do to set up an development envionment and get the source
Of course it is possible the OSX instructions are no longer quite correct for Snow Leopard but they should provide a good starting point.