That shouldn't be too hard. You will need the following:

> A way of retrieving the mouse coordinates (which i assume you allready have, because you allready made buttons).
> A way to render a rectangle, and a cursor line (Take a look at rendering line-lists in Direct3D using D3DPT_LINELIST.)
> You should have a routine to determine the width of a text, so you know where to put the cursor line. As i'm using my own font system, i cannot say what function you should use for it. maybe ID3DXFont has one.

Can you describe your problem in a more specific way. I can write pages of info for you, but i don't want to do that. You must try first, and ask some more specific questions.