A little past that room with the friendly creatures (I'm assuming it's the shop with the friendly Gaudi in it), and down in the right-hand corner is a small "Camp" area with a doctor, a nurse, and Curly resting on a bed. The doctor will give you the clinic key and ask that you go get some medicine from the clinic (they've been chased out by a "ghost").
As you exit the camp, the upper left corner of the screen is where you should look for the clinic. If you took the Machine Gun earlier, and have it up to level 3, boosting up there by shooting downwards is the easiest way to get up. Otherwise, you'll have to do a few tricky jumps to get up. Fight off the monster in the clinic (the blade is wonderful here), obtain the medicine, and head back down to the camp to give it to the doctor. Once you get to that room with the boulder again, Curly will join you, and I don't really want to spoil what happens next.
If you're going for the "best" ending, and haven't taken the machine gun, make sure you don't take the item the professor offers you in that room before the final one with the broken teleporter, though.