The first thing to say is that you should not use the random dungeon encounters in the DMG (ie, p174-179) to stock anything, anywhere, ever, especially your first adventure. Those tables are for wandering monsters and even then represent "emergency use" only for when you don't have your own wandering monster tables tailor-made for your adventure.
The next thing is that "the cave" can be a lot of other things. The classic, of course, is the dungeon - perhaps an ancient remnant of a long-ruined castle or even the accumulated basements of a city (deserted or otherwise). It can also be, as in the Conan Story "Red Nails" an enclosed city sealed off from the world outside with labyrinthine passages and corridors on multiple levels. It can be the inside of a manor house or castle, or even a large farm and its collection of out-buildings.
Assuming you have picked a setting then think about the map. Who built this place or, if its a natural thing like a cave system, who/what has moved in? Some monsters are going to be within so they will have some reason to be there. If they didn't build it, will they have modified it for their own use? Will they share it with other monsters? If so, do they get on or merely tolerate each other? Or are they actively fighting over who can remain in the place; could the players exploit the factions? Thinking about these things should get you thinking about the map; sketch it out on graph paper in pencil. Don't leap to the computer or even to pens until you want a neat copy to sell to people or put on the Internet.
Before going any further, have a think about the level of party you want to challenge with this scenario. When playing "start at the door" scenarios the players don't get much of a chance to decide where they want to go so the DM has a responsibility to not clobber them. Add up the hit dice in your expected party and add one for for each character with spell casting or other "special combat power" then multiply by the number of fighters and clerics. That number will be a rough (very rough) guide to what you should throw at them in one go. Generally, any hostile encounter that is this level or higher (when counted in the same way) will result in even a victorious party needing to fall back for recovery time; anything less than a quarter will be just a bump on the road and about half should be a good fight.
For example: a first level party consisting of two fighters, a ranger, a cleric and a magic user would have a score of 32 (rangers starting with 2 HD). 6 orcs (score of 36) will be a very dangerous fight if the magic user has not got sleep available; 2 orcs (score of 4) should be easy; a single ogre (5) should go the players' way but three or more (36+) should be avoided. It's a rough rule and you'll have to apply some sense, and it breaks down at higher levels. A monster with 1HD which does 1d12 damage is capable of eliminating one first level character per round with lucky rolls. Poison is likewise a very dangerous thing at low levels.
When you're laying out the map and the monsters in it make sure that any monster that is placed in a choke point is not something the players can't cope with. "Cope" can be combat, or it can be negotiation or trickery etc. but there's no point barring entrance to part of your adventure with something which is too much for the party. There's no problem having a couple of encounters in the adventure where the "correct" answer is to run away; just don't do it where the characters have no choice.
Let's go with the cave for now as an example of stocking a "dungeon". We'll assume that the cave is actually the entrance to an extended cave system which goes down and back for some distance with side passages and chambers which take the place of rooms in a more man-made dungeon. As a guide, only about a third of these should have encounters with monsters, and a few more should have other things to do such as difficult routes requiring some care and planning, perhaps some parts go under water to the next area. There's lots of material online about pot-holing which can give inspirations but don't over-play the realism card - this isn't a game about pot-holing, just one that sometimes contains some.
Perhaps the outer cave it has recently been joined to this larger system by some mining activity from the other side. That sounds like kobolds to me - evil Germanic gnomes/mining spirits (and not reptilian dogs, but in either case let's go with it). According to the Monster Manual, they come in packs of 40-400 when in lair. That's a lot. But let's decide that the 40-400 live deep into the system somewhere and that the recent troubles are the work of an extended scouting group. That's quite nice as it allows the players to probe and for the monsters to respond with both sides trying to determine the scope of the opposition over a longer period. So we'll make the main opposition to be a kobold clan of 4d20x10 members with the various extras listed in the MM. Giant weasels make more sense here than boars, so we'll include them. I'd also throw in a clan shaman as per DMG p40.
Dungeons are laid out with a standard logic which says that the weak live near danger and the strong get to relax in the safer areas. In other words, monster level correlates to dungeon level. The kobolds that the party meet initially will have been sent by the leadership which lives deeper into the cave. Depending on how things progress, that leadership may fall back from a strong assault and never be directly encountered, or may mount a determined attack on a party that seems weakened by combat or something in between. In any case, the vast bulk will be on the lowest level or even totally "off-camera".
What else might be in here? For a first level adventure, you want to stick to 1st level to 3rd level monsters and very few of the latter. Some might be using the caves as a lair, setting up a relationship network with the kobolds, and some will be passing through. Divide the cave into three levels to reflect this decision. The "levels" need not be arranged vertically, they can be zones of distance from the surface marked by guard points or obstacles. The kobold leaders, females, young, and eggs will be in their part of the third level which will be heavily guarded.
Note that kobolds will be in total darkness but the sounds of their mining may carry a long way but equally may be baffled by the passages so judging distance and direction may be hard. Additionally, any passages made by kobolds will be kobold-sized, which will present problems for most player characters other than gnomes.
OK. That's enough bloody kobolds.
In addition to the kobolds, obvious 1st level candidates are giant rats, shreaker, small piercers, perhaps cavemen if you want to have inter-monster rivalry (probably need a different backstory for this), goblins, badgers, brownies and/or gnomes (possible allies are nice plot hooks), and maybe some fire beetles.
For second level monsters, a wild boar sow might make a challenging encounter, giant centipedes, the various forms of giant frogs, lizardmen, strangle-weed, ordinary (ie, without character classes) elves, myconids, stirges, atomies (exploring the cave entrance), and vapour rats can be placed or randomly encountered. For less run-of-the-mill stuff, a manes demon, brain mole, or female centaurs (oh, there's a whole heap of potential trouble there) might be worth thinking about.
Possibilities for third level monsters are the smallest anhkegs, carnivorous apes, bugbears, male centaurs, larger giant frogs, ogres, huge and large spiders, cave fishers, minor derro, mongrolmen (note their alignment), ophidans, large scorpions, and various giant snakes.
Monsters up to fifth level can be encountered on the 2nd and 3rd levels according to the table on p174 of the DMG but I would suggest counting them as third level monster encounters if you use that as the basis of your own table.
Not all third-level monsters have to be in the third level of the dungeon. Creatures such as centaurs only make sense to be encountered very near or in the outermost cave mouth, perhaps sheltering from weather or looking for a camp site. If your random table indicates something that doesn't make sense then there is no encounter.
As with the kobolds, parties of other monsters encountered at random should be scaled to the expected party, with a bit more range if placed in specific points of the map where scouting can allow the party to determine threat levels.
Once you've assembled the cast list, you need to place them and their treasure. For each monster type you have, roll the chance of being in lair and the numbers occurring (overruling freely results that you don't like). Those that are in lair will contribute their lair treasure to the stock in the scenario; others will contribute only their individual treasure. Creatures "in lair" will have a stronghold somewhere with the bulk of their treasure, but again need not all be sitting on top of it in one room. Intelligent monsters will be using any magic items they can and these will not be in the main hoard but carried with individuals.
Treasure is given in the MM as chances to have certain sorts of item, from copper to maps and magic items. These are based on a middling number of monsters - 2-3 dragons, 10-11 orgres, 220 kobolds etc. For smaller numbers the books says to adjust the amount otherwise, but not how to adjust it.
My suggestion is to increase or reduce the amount but to keep the chance of each sort the same. If this results in a number less than 1 for gems, jewels or magic then use that as a chance for a single item of the type. In the case of reduction, reduce by 20% per full 20% below the (lower) average the number encountered is, and for increases increase by 10% per full 25% above the (higher) average. Thus, if 40 kobolds are in lair the lair treasure will be reduced by 80% and if 400 are encountered it will be increased by 30%.
For monsters that occupy more than one area, any lair treasure may be spread out so long as the only access to it is guarded or trapped. Many evil monsters will not trust each other, let alone other races and if you role-play their attitudes to each other and their treasure you should be able to get a feel for how to place both monsters and treasure.
Once you are happy, put together some wandering monster tables for each level and you should have a basic scenario ready for the first game. Or, at the very least, a mess that has taught you what you don't like.
It's not going to break new ground or win any awards, at least not on paper, but it should be reasonably balanced, have a decent level of treasure and some internal logic.
Read over DMG pages 104-105 on the subject of Monsters and Organization before you start running the game and you should have plenty of inspiration for controlling the monsters in your brand new dungeon.
The next post will be on character generation.