You don't specify which operating system you are using, but you need to download the
Windows Driver Kit (WDK)[
^] (The link is for Windows 10)
By installing the WDK the command line tool
DevCon[
^] will also be installed.
Quote:
DevCon (Devcon.exe), the Device Console, is a command-line tool that displays detailed information about devices on computers running Windows. You can use DevCon to enable, disable, install, configure, and remove devices.
The
source code[
^] for DevCon is available as well, so you can see how things are done in this application.
I hope this info will get you started.