DirectX9 has utilities (prefixed with D3DX) which can do what you need. Use this function:
unsigned int slices,
unsigned int stacks,
But if you don't want to use DirectX's mesh structure (D3DXMESH), then you'll have to generate the sphere yourself.
If you're interested, I can make a short article on implementing the algorithm for both OpenGL and DirectX.
Hope that helps.