What I would like to do is write a small program that continuously live counts the number of context switches that a specific process experiences per a sufficiently small unit o
A little searching on the Internet and I found this thing called "Performance Counters", you can either provide counter data or consume counter data with it. In your case, I believe you want to read the data from Performance Counters.
You can consume performance data using either the registry interface or the PDH interface. The PDH interface is easier to use than the registry interface and is recommended for most performance data collection tasks. The PDH interface is essentially a higher-level abstraction of the functionality that the registry interface provides.
Here's another article from Microsoft on Monitoring Context Switches.