Could it be to do with the function I am using to get the right rotation matrix?
No, it could not. Rotation matrices are not triangle-selective.
Neither are depth-buffer issues.
The only possible issues are:
* Triangle winding.
* Misaligned (corrupted) index buffers (if using index buffers).
* Corrupted vertex buffers.
* Misuse of vertex buffers (telling Direct3D that it is a triangle strip when it is in fact a triangle list, etc.)
If it takes multiple render calls to draw the object then there is also:
* Mismatched materials or invalid materials (resulting in blackness) assigned to triangles. This seems least likely.
Each of these is quite easy to test one-by-one.
If culling is disabled and it persists, then it is not a winding issue.
Testing if it is related to materials is trivial—make your shader return a hard-coded color that gradates with depth (if the whole object is a single color you won’t be able to tell if anything is missing, obviously) and a hard-coded alpha value of 1.
I only mention these first because they are so trivial to test, but it is likely to be related directly to the vertex buffers themselves. Either the vertices themselves are corrupted or they are being misrepresented to Direct3D via a bad index buffer or wrong flags on the render call.
I found out that when I try and[sic] import the model into Blender there is a similar problem with black missing triangles. Why would this be?
Why not explain to what format you exported in the first place? Is this your custom exporter and importer? If so then this is not useful information. If it is being exported and re-imported from a file format such as .FBX, it means the exporter itself is corrupting the vertex data.
Either way, all signs point to the vertex buffer.
Use PIX and verify the data being sent to Direct3D.