This is a neat thread.
I had this happen a few years ago. I don't remember the dream, but there was background music to it-- it was a melody with some counterpoint and some drums.
The thing is, as is usual, my memory of the dream/song was fading away as I woke up so I had to work fast. All I had was my laptop so I had to mouse all of the notes in on a sequencer. I got most of the melody/counterpoint down as it was in the dream. I had to fill in a few blanks here and there, but I was pretty pleased with it and think it's faithful.
I've tried to add lyrics to it without much success. I think I'll revisit it and keep the melody/counterpoint, use it as an intro/outro thing, and create a verse and chorus to go with it.