Can you program a micro controller to be a uart to usb bridge?
Any USB to UART bridge IC that you see in the market is already an MCU that has permanently committed firmware (may be in Flash or ROM). These also typically have dedicated UART and USB peripheral block on the chip. Using pure software to implement UARTs and USB line level protocol severely limits speed possibilities and would generally not be practical.

Many of the more modern day MCUs that have on board USB controller peripherals will have available App Notes and reference code that shows how to build a USB UART bridge. In some cases this just becomes a part of a much larger application that runs on the MCU. In particular if you have some 200MHz 32-bit MCU this becomes very practical to even support an RTOS and task processing for an application in addition to the bridge functionality. 

Note: An MCU operating in this manner as a bridge is referred to as a USB CDC class device.