How do I render a mesh using a custom set of shaders?

I have managed to solve this by not using a vertex factory and setting the shaders and such myself.