There are lots (and lots and lots) of tools which can help you populate a dungeon, or roll up a random scenario. The problem I find with these is they don't really do the hard part of adventure invention for you. They say: "There's a goblin in this room, and nine in that room, a troll in that room. and a treasure chest in this one". Ok, thanks, that's good as far as it goes.
But really, in an adventure, what's actually in it is only half the deal. What the relationships between the things in it are are just as important Plus: most DMs have a few ideas about what they want in the adventure to begin with--it's making it all fit together that's the hard part.
I use the following method myself sometimes with megadungeons or worldbuilding and used it yesterday with Mandy--who is new to DMing and trying to figure out how to write adventures...
Step 1. Think of a handful (or more) of things you want in your adventure (or dungeon, or world, or city, or whatever--it works on any scale). These elements can be anything: monsters, NPCs, items, cities (possibly even themes, though I've never tried that). In this example I'm using: Witch, Giant Spider, Magic Dagger and Evil Monkey. If it's hard to pick elements, you can use one of the zillion random dungeon/hexmap/etc. generators out there to pick some for you.
Step 2. Write the elements across the top and down the side of a grid like so:
You put them in the same order left to right and up to down.
Step 3: Start with the top entry in the left hand column--"witch", move right, skip the first column (it also says "witch") then go to the second. "Witch-Giant Spider" think up a relationship between the witch and the giant spider, write it in.
Then go on to the next column--write in the relationship between the witch and the magic dagger, then the monkey.
Step 4. Go down to the next entry in the far left column--"Giant spider". Skip the first two columns, we already did "witch" and the second column is "giant spider". Go to "magic dagger"--we haven't done the "giant-spider--magic dagger" relationship so we do that now. Then "giant spider--evil monkey" etc. When you're done making a relationship between every element and every other element in the adventure it'll look like this...And that's pretty much a whole night of D&D right there.
If you do it for a lot of elements, it'll end up looking like this mileage chart...
...with a long diagonal of empty spaces down the middle. (They've repeated the same values in the top right half and bottom left half of the table for convenience--you obviously don't have to do that.) After a few sessions of a campaign you can take all the NPCs and monsters you invented in the breach and stick them in the chart and start building up a world with some internal consistency. and it starts to write itself.
Anyway, there you go.
By the way: anybody know what these kind of mash-up charts are called? They are kind of like Punnett Squares, but they aren't exactly that.