Thanks to Eugene and his crew over at Attrice, the makers of the Team Build Sidekick and other Team Foundation Sidekick widgets. They have just published a nice article describing how they have used the Team Foundation Server Version Control object model and VS automation to implement their product’s functionality.
Check it out.