In Windows Vista and beyond, you can use the device arrival and removal notifications and retrieve the endpoint formfactor to determine if the manufacturer of your audio solution considers a particular endpoint a “headphone”.
Before Vista there was no way of determining this information.