S., when your child has allergies that severe it can be scary, I know! My daughter outgrew some mild allergies (eggs, corn, soy), but these only caused skin reactions. When she was in kindergarten we discovered that she is deathly allergic to pecans (we have the epi-pen too). Technically, she needs to avoid all tree nuts, but she also chooses to avoid peanuts and peanut products (even though peanuts aren't a "nut" at all, they're actually legumes, but I respect her caution...)
The fact that your daughter didn't have a reaction to peanuts the first couple of times she ingested them is fairly typical. Sometimes children don't react to a food until they've ingested it multiple times. (not sure why that is).
If your doctor gave you an epi-pen, that means the allergy is obviously quite serious. The whole thing is totally managable, if do the following:
1) read every label thoroughly, and teach your child to do the same. Seriously, she is old enough to stand there in the grocery store and read the labels if she's with you while you shop. This is HER life on the line, and you'll not be with her every minute. She needs to know this is not a joke.
2) If the food she's offered isn't prepackaged (no labels to read), she needs to ask the cook directly (in person!) if any peanut or rice ingredients were used. If the cook isn't available -- if, for instance, a child brings in a home-made birthday treat and the mom isn't there to answer questions about preparation, she needs to say NO THANK YOU. This can be upsetting, but most schools do instruct the children not to bring in foods that contain nuts, and most will also let you store something at the school for such "emergencies"...rice crisy treats wouldn't work for your child, obviously, but something that will "keep" and that she CAN eat when the others are enjoying the b-day snacks (maybe some Hostess-type snack cakes, assuming the ingredients are non-threatening, natch).
3) be VERY careful in restaurants! teach her to always, always ask about nut/rice products and oils. again, most restaurants are pretty scrupulous about this these days. IF you ask. But all the ingredients used in prep may NOT be listed on the menu. Also these ingredients can crop up in many foods you wouldn't necessarily think to ask about. Even french fries are sometimes prepared in peanut oil. (my brother had to go the ER once during a wedding reception because he ate shrimp that had been cooked in some kind of nut oil...)
4) she needs to learn to be overly-cautious, so praise her for asking about everything, even when it seems silly. (I swear my kid will read the label on a popsicle box to check for pecans, and grills her own grandmother about the ingredients in her cookies -- a little goofy, yes, but infinitely preferrable to an ER visit, or -- god forbid -- a potentially fatal reaction.
5) IF she accidentally ingests peanuts or rice, take her directly to an ER, and instruct her school to do the same. Even if her breathing seems fine, her blood pressure can drop quite suddenly (anaphylactic shock) which can be fatal.
6) NEVER use the epi-pen on your child unless explicitly instructed to do so by an ER doctor via telephone. That thing is a LAST resort used ONLY if she's already in shock, or having respiratory failure, and the ambulance won't be there in time. (your doctor probably told you this already, but just being "safe")
7) Here's one I didn't think about ahead of time (and caused us one ER visit): be careful about holiday chocolates shaped like characters (santas, bunnies, etc.)! There are websites that sell beautiful, nut-free versions of these, but nearly EVERYTHING sold in stores DOES contain nuts, and the individually wrapped chocolates usually don't have labels.
I know it sounds frightening, but really, truly is very, very managable if you and your child are cautious.