Some applications can take up over 300MB, such as iWeb, while others are about 5MB, like Chess. Together, that could take up 1 or 2GB. Because of the system formatting, you wouldn't have exactly 40GB to work with, so I'd guess there's a little under that available. Click Get Info on your hard drive and tell us what it says the maximum capacity is. This means that there's another 20GB of something somewhere. The system would take up at least 5GB or so, depending on what configuration you installed on it.
Looks like that there could be some more files somewhere taking up the rest of the space. iMovie and iDVD projects could easily fill that space up. You may want to look around so more.

-BMF