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
ETW (Event Tracing for Windows) will give you much deeper information on context switches if you want to. The code likely be significantly more complicated than access to performance counters.
Initial links: Core OS Events in Windows 7 and Windows Performance Toolkit Technical Reference
Search terms: "ETW context switches", "xperf"