The question was regarding C#.
An example usage of MMDeviceEnumerator can be found in the C# open source project NAudio at
http://naudio.codeplex.com/ with the latest source at
NAUDIO Source[
^].
Once you reference the project with
#using NAudio.CoreAudioAPI
then you can enumerate your audio devices with the following...
var deviceEnum = new MMDeviceEnumerator();
var devices = deviceEnum.EnumerateAudioEndPoints(DataFlow.All, DeviceState.Active).ToList();
The MMDeviceEnumerator is defined as follows:
[ComImport, Guid("BCDE0395-E52F-467C-8E3D-C4579291692E")]
class MMDeviceEnumeratorComObject
{
}
and if you look up the GUID reference in the registry, it is implemented in the file MMDevAPI.dll