Robert Horvick, now a dev on the version control team, has been writing a series of posts on using the branch and merge API methods.  If you want to explore that area, I recommend checking out his posts.

Following merge history using the TFS command line is the introductory look at what he's trying to do.  Then he walks through creating a tool to determine whose contributed what via merging.