Fantasy/sci-fi, absolutely. I might be a little biased, seeing as how I write fantasy, but that's the stuff that really gets young minds interested in learning and exploring things. You really want to change the world for the better? Get kids reading Arthur C. Clarke or Terry Brooks or Ben Bova or Robert Jordan. Get them questioning everything, wondering about the nature of reality itself.
Of course I have. In my "Legends of Kiamada" series, the relationship between Ellie and Doyle was directly inspired by my relationship with my wife's younger sister. (When my sister-in-law read the book, the first thing she said to me was, "Their relationship is basically ours, but with magic involved, huh?")
I've also incorporated conversations or actions or small things, like a type of car somebody owned. Just things to make the characters and story feel more real and grounded.
For me, the most important element of good writing is creating characters I like and care about, that I feel are real people. If they're not convincing, I'm not going to sink into the story as deeply as I want. Their conversations and interactions should feel like something I've experienced myself.