Good ****ing luck. Check the pieces that came out; they are very thin pieces of plastic, so you have to make sure one of the very tiny tips where it secures itself aren't broken(they're horizontally symmetrical. If one side has a tiny tip at the end and the other side doesn't, it's broken). If they're broken you're ****ed. You'll have to buy some new keys(you can find them on amazon/ebay). If you want, post a picture of the pieces(not the key) against a white piece of paper, with the best quality you can. I'll tell you if they're broken.
Otherwise the two pieces of plastic will fit together under the key like an X. From there you're just going to fight through hell to get it to snap back into place(provided they aren't broken like I mentioned above). Put the rubber piece in the laptop before you put the key in. You can probably google your laptop brand and find some in-depth instructions/videos on putting the keys back.