So you need to change the driver loaded for a given device from your application. You have a couple of options to do this.
The first method is to use the
UpdateDriverForPlugAndPlayDevices API. This method is simple and straightforward to use. But the downside of using this API is that it will update drivers for all devices with the specified hardware id. So if you need to selectively update one of the devices with a new driver you will have to look for something else.
And that method is by using the
InstalledSelectedDriver API.
Sample Code: How to use InstallSelectedDriver to update driver ?