Every author's experience may be different, but I got recommended to my publisher by someone who had been impressed by my articles in the JavaRanch Journal. So my advice would be to write a blog or submit articles someplace that are good enough for people to notice.
In these days of Twitter and Facebook it's easier to get attention than even a few years ago.
Or if you just have a great idea, write a sample chapter and submit it to one of the publishers. It just better be really good if you want to get noticed coming in cold.
I'm sure others will have some great suggestions too...
+1 everything Bear says. Having someone recommend you is infinitely better than just sending in ideas cold. I'm not saying I have worked with any publishers that do this, but it's not unheard of for a publisher to take an idea for a book they get in the mail and hire a known author to write it, leaving the idea man out in the cold.
The truth is that ideas are a dime a dozen. If you have an idea for a book, then an editor will have their own ideas about how to change it into something that fits their publisher's vision, and it might not resemble your original idea at all by the end anyway.
What really counts is a proven ability to write to a deadline. That said, writing a regular blog is an awesome thing, because you can then show it to a publisher and say "look, I've written an article a week for a year", or whatever. As the saying goes, half the battle is just showing up. Prove you can write to a deadline by writing regularly and well.
P.S. Whatever you do, do not write a whole book and then shop it around. No one will touch it -- editors want to be able to guide the development of your book.
Pat is correct. Anyone who is writing tech books for the money is a danged fool. It does indeed pay lousy. (At least for the vast majority of authors. There are the rock stars like David Pogue who can make a living at it, but for most it's some nice supplemental income.)