Check out the Primitives sample on this site. That is for 2D, but would need only minor changes to do the same thing in 3D. At the moment it just sets all the z values to 0: if you put something other in the vertex z and provide a suitable projection matrix for the BasicEffect, the same code will draw in 3D.
XNA Framework Developer -
blog -
homepage