You can control PMC data collection through Model-specific registers (MSRs). See Appendix A of the Intel 64 and IA-32 Architectures Software Developer's Manual, Volume 3B) for details. VTune uses its own driver for programming MSRs. On Linux there is VTune driver kit that goes along with package with sources. I don't know any driver kit available on Windows.
WRT context switches, regardless to OS type the PMC data is being collected along with thread ID, so you get thread specific counter data.