<p>I tried to write a <code>TransformMesh</code> function. The function accepts a <code>Mesh</code> object and a <code>Matrix</code> object. The idea is to transform the mesh using the matrix. To do this, I locked the vertex buffer, and called Vector3::TransformCoordinate on each vertex. It did <em>not</em> produce expected results. The resulting mesh was unrecognizable.</p>

<p>What am I doing wrong?</p>

<pre><code>// C++/CLI code. My apologies.
int n = verts-&gt;Length;
for(int i = 0; i &lt; n; i++){
        verts[i].Position = DX::Vector3::TransformCoordinate(verts[i].Position, matrix);
}
</code></pre>

Without contextual code around what you are doing, it might be hard to know the exact problem. How is the mesh created? How is verts[] read, how is it written? Are you trying to read from a write only vertex buffer?
My recommendation would be to try with a very simple translation matrix first and debug the code and see the vertex input and output. See if you receive good data and if it's transformed correctly. If so, the problem is in vertex stride, stream declaration or something else deeper in the DirectX pipeline.
As I said, more code would be needed to pinpoint the origin of the problem.