In many small microcontroller systems there is no operating system as such. One writes code to control all the aspects of the device, e.g. scheduling events, handling IO interrupts, etc and downloads it into the program memory. Usually, the manufacturers of microcontrollers supply support librarys, e.g. APIs for USB, networking, ADCs, Canbus, etc.
Larger microcontrollers could well come with an operating system such as a real time UNIX