usually it's the same as number of materials for that mesh
there is also functions to getattributetable, that can tell you exactly what amounts of subsets mesh has and for what vertices each subset is set
as i remember 16 bit indices limits model to ~ 65000 vertices.
try using some form of 32 bit indices
some variable u using in loop may be too small(it happens rarely, but check it anyway)
what fails? and with what hresult, what debug runtime says?
it's a good programming to alwaya check d3dx create calls with hresult!