I am exposing/teaching my childeren 5yr and nearly 3yr very similar to what Horkos and TheSp8 said. Obviously depending on maturity and behavior of your child, but I believe one should never make it a forbidden and unresolved curiosity.
I started out by letting my older son help me clean them (prob 3.5 to 4yrs at the time), while cleaning I went over safety rules with him (I added "Never be around a gun unless mom or dad is around" to the top of the 4 NRA basic rules). I printed out a copy of these rules for his own began going over them with age appropriate fill in the blank type memorization of the rules. “Never point a gun at…..________” fill in the blank type stuff moving on to “What is rule #2” once he began to get them memorized. I would tell him that he may ask me at any time to “practice” with my guns (field strip and put back together a few times then aiming at a target and dry firing) but he could never do it on his own, and if for whatever reason I couldn't stop and practice with him I would not tell him no, but I would schedule a time that we could. Not that I am so busy that I need to schedule time with my boy but that way he would get a different response than the adult standby, "not right now" in hopes they forget about it.
He began to ask about my gun periodically throughout the day/evening and I would stop what I was doing, clear the gun and practice. These "practices" would last a few minutes to about 15 sometimes. Yes, it was inconvenient at times but I believe the knowledge is far more than worth the hassle.
After several months I took him to a spot in the boonies and shot some live rounds. After actually shooting my guns he doesn't ask to practice nearly as much but he does ask to find time to go to the range which is harder to do.
All the while my younger son wasn't interested very much, he would sometimes watch and listen to our practices other times he would run off to play with his toys. In the past few months he has begun to ask to practice, so the pattern starts again.