There's a couple of ways to do it. There's a pretty nice freeware text adventure authoring system called "tads"
http://www.tads.org/
TADS is a programming language, but it's optimized for text adventures, and it's reasonably easy to use, even if you've never programmed before. It comes with quite good documentation and tutorials.
If you're handy at HTML, you can use HTML and CSS to build a very complex text adventure. Simply build a page for each room and use links to connect the various rooms. The advantage of this is you can add graphics and formatting to get a nice look.
Of course, you can use a programming language to build this type of program as well, but you should be familiar with text parsing. I have some examples available (using graphics, not text-based) in Flash:
http://www.cs.iupui.edu/~aharris/flash/fg2r03/adventure.html
And the same game done in a completely different style in Python:
http://aharrisbooks.net/pythonGame/ch10/adventure.py