There is no example how to detect if headphones are plugged in or not via C#.
I assume should be some event for that...
Does make sense to use WMI?
Detecting changes of this kind is possible by using the IMMDeviceEnumerator::RegisterEndpointNotificationCallback method.
As you want to handle this in C# you will need a managed wrapper which has already been implemented by Akos Mattiassich. You can find a thourough example here: Managed Wrapper around MMAudioDeviceApi
He states:
The program can play test sound on selected devices and it updates the list automatically on changes eg. through the control panel or in case of plugging new device physically.