In addition to audio playback and recording, Windows Multimedia (WinMM) provides a Musical Instrument Digital Interface (MIDI) API.

Here's how to make a list of all the MIDI devices on the system, their capabilities, and the hardware device interface associated with each of them.

Source and binaries attached.

Pseudocode:

midiInGetNumDevs or midiOutGetNumDevs
for each device
    midiInGetDevCaps or midiOutGetDevCaps
    log device capabilities
    midiInMessage or midiOutMessage
        with DRV_QUERYDEVICEINTERFACESIZE
        and DRV_QUERYDEVICEINTERFACE
    log the device interface

Output:

>midienum.exe
midiIn devices: 1
-- 0: USB2.0 MIDI Device --
    Device ID: 0
    Manufacturer identifier: 65535
    Product identifier: 65535
    Driver version: 1.6
    Product name: USB2.0 MIDI Device
    Support: 0x0
    Device interface: "\\?\usb#vid_xxxx&pid_yyyy&..."
midiOut devices: 2
-- 0: Microsoft GS Wavetable Synth --
    Device ID: 0
    Manufacturer identifier: 1
    Product identifier: 27
    Driver version: 1.0
    Product name: Microsoft GS Wavetable Synth
    Technology: 7 (MOD_SWSYNTH)
    Voices: 32
    Notes: 32
    Channel mask: 0xffff
    Support: 0x1
        MIDICAPS_VOLUME
    Device interface: ""
-- 1: USB2.0 MIDI Device --
    Device ID: 1
    Manufacturer identifier: 65535
    Product identifier: 65535
    Driver version: 1.6
    Product name: USB2.0 MIDI Device
    Technology: 1 (MOD_MIDIPORT)
    Voices: 0
    Notes: 0
    Channel mask: 0xffff
    Support: 0x0
    Device interface: "\\?\usb#vid_xxxx&pid_yyyy&..."

(Actual device interface string suppressed.)

Note the Microsoft GS Wavetable Synth device, which is always present.

Why would you want to know the device interface? In our case, because we want to test all the audio-related interfaces of a particular device on the system.