What's stopping you? I do that on Windows; the trivial example of "add two numbers" is a 4kb DLL.
You don't use the standard library, the equivalent of the kernel syscall API is there (the win32 API), and you have the ecosystem of no_std libraries available.