Elixir42 0 Junior Poster in Training

I have a function to detect if the mouse is over a mesh but what if I had a hard coded square. I am using D3DXIntersectTri() and pluggin my vertices into it. but they (obviously) dont update when I move the square. My question is how do you get the vertex data from the vertex buffer. So I could potentially change a vertex on the fly. Am I doing this the right way?