Depends on what type of music I am writing, really.
For jazz, fusion, or blues rock type stuff, I normally just jam out ideas, record it and then whittle away bits in a program until I find choice nuggets, then structure a song around that.
For metal or progressive rock, I tend to sit with my instrument and, after a couple warm-up exercises, I will fiddle around with specific ideas until they work themselves out into what they are, good or bad. Then, I stockpile them and listen to them later when I am far enough away timewise to judge them.
I also find it differs greatly what instrument I am writing with at the time.
For instance, if I am working on something with my drumkit first, getting a solid rhythmic foundation, a great deal of the song comes to me at once and I can do most of the rough work on a song in about half an hour to an hour, complete with ideas for melodies, harmonies, some lyrical ideas, and structure, as well as getting most of the drums done. Meanwhile, if I am using my guitar, I tend to be able to only really come up with melodies, harmonies and chord structures, which I then keep in mind when I switch to drums to work out a good structure. And almost all of the things I write on piano tend to be either piano solo pieces or atmospheric music with maybe some slow guitar work or light drums or something. I normally head to keys last to get ideas for harmonies and chord progressions.
My standard tends to be working on something on drums first (as that is my first musical love and the instrument that I have the most experience on by far, over ten years worth), then once I have a good structure worked out, I'll go through old riffs and melodies I've written on guitar and see what fits and, if nothing does, I'll write something new. Then I'll go on keys to get some chord changes down and use that plus my drum rhythmic patterns and structure ideas to begin making the skeleton; i.e. bare drums, keys and guitar, and maybe bass if I feel like pulling it out and recording something.
The final step is always me showing the piece to people to try and find people to play on it and help flesh out the track with their own touches and then no one wants to, so I eat the tape like a goat in front of them and bury myself up to my neck in garbage I find on the street.
And every now and again, I'll write lyrics first, then craft a song around whatever mood I feel the lyrics need. I'll normally include notes with lyrics I write on what kind of musical backing each section would need. Oddly enough, I've found that writing multi-part progressive rock suites comes much easier to me than writing regular ass, normal fucking songs. Which is both annoying and pleasing in different ways.