I know that I can access the cyclomatic complexity to my code in Visual Studio 2008 Team Explorer by right clicking and selecting \"Calculate Code Metrics\". I would like to
There is no API. But you can read an XML file generated by the Code Metrics Power Tool. So you would generate the code metrics XML file by command line like:
metrics /f:MyAssembly.dll /o:MetricsResults.xml
Then grab the data you want out of MetricsResults.xml.
More info on the power tool here.
If you want to run code metrics in your TFS build, see here and here for options.