This is done all the time with embedded systems. What ever you write IS the OS essentially.
Are you developing a hardware embedded device?
Some example systems.
PARADIGM C++ PROFESSIONAL IDE. Borland C++ 4.5 with a bunch of embedded extensions. I've used it.
PocketPC and Windows CE could be candidates.
There is also Windows Embedded.
Edit: For clarity below was for an X-Ray Generator where all the code I created was the OS. It was not Win-Embedded and not a pink cell phone.
If you have the storage (Compact Flash card, SD card, or just enough memory, etc) create and save all your UI elements as bitmaps. I used GIMP to create the graphic elements and HEXWorkshop to convert them to a binary format the device "understood."
In the UI create "hotspots" (regions/rects) that act as buttons, or whatever, that can trigger events that mimic OnClick, etc. Hopefully, that should get you started. Look up Win32 "OwnerDraw" buttons. It will show you a good methodology for this, especially if you end up in Windows Embedded.
If you are interested in Linux go here: http://www.linux.org/dist/ they have some tiny linux distro's made for embedded systems.
HTH