If you are an Exchange developer and haven't checked out Glen Scales's blog then you are missing out.  Chances are he has written part of your project for you and posted it on his blog.  Check out his latest post for a script which generates a report of mailbox size broken down by the age of messages...