What does the operating system have to do when a USB device changes its configuration?

I am learning about how the kernel interacts with USB devices, and I'm curious as to what the OS actually needs to do when a USB device changes it active configuration.

There must be some processing the host must have to do perhaps with power management? And what priority does the USB host have over other actions on the machine?