This has been done before for images (not bitmaps) - I can't remember who did it, but I provided code that helped him.
There are several Make* functions in the Image DLL that you can use to create an image of the size you require. There's also a function that allows you to get the DX texture pointer directly, so you can lock it, write to the texture memory and then unlock when done.
For bitmaps, I don't think you can get the DX surface pointer, but you can call the lock function, get a bitmap pointer and then write to the memory directly.
Basically, both the same techniques, just with different ways of doing it.