Over six years ago, I posted a sample on how to use the version control API. The API changed in TFS 2010, but I hadn’t updated the sample. Here is a version that works with 2010 and newer and is a little less aggressive on clean up in the finally block.
This is a really simple example that uses the version control API. It shows how to create a workspace, pend changes, check in those changes, and hook up some important event listeners. This sample doesn't do anything useful, but it should get you going.
You have to supply a Team Project as an argument.
The only real difference in this version is that it uses the TeamFoundationServer constructor (in beta 3, you were forced to use the factory class).
You'll need to add references to the following TFS assemblies to compile this example.