We've taken our kids to several family funerals, and some for friends. You're right...it can be a tricky situation. We've used this time as a way to show them the ending of life, which is a part of our lives. This is also a time to talk about our faith with the kids. Both my husband and I talk to the kids before hand telling them what to expect (for open caskets something like: "There will be lots of people crying, and if you want to cry, it's ok, but you don't have to if you don't want to." or "you'll see a body of great-grandma laying in what looks like a pretty box, but we believe her soul is in heaven. Our soul makes us who we are here.") The kids can take what they can handle from our words, and then seem ok. (...or "mommy and daddy might cry because we're sad. Will you hold my hand like I hold yours when you cry?") If they have questions, we answer them, and encourage them. In my experience, death is scary mostly because we are not around it so much or don't understand it. When we treat it as "just part of life," it makes it easier to deal with.
The other thing we do with funerals is to remind the children what kind of behavior we expect. Being quiet, sitting still, etc. For the funeral, I'd take "quiet toys" for them to play with, so we wouldn't be setting the kids up for failure, but setting them up to succeed. I have not been disappointed in their behavior....I have always been surprised at their comments or questions, but that's the joy a small one's perspective brings!
We've also chosen not to take them to funerals. Could you get a sitter? The thing that decides for us whether or not to take them is more about us....would you be ok NOT being there to support your husband? Sometimes it's better to grieve while caring for youth as they're the future, not the end. Sometimes it's better not to have the children.
For me, I often choose to go. I talk and talk to the kids about what they'll see, what I expect, etc., and my husband does the same. I think it's important for them to understand the whole life cycle....but when you choose to teach them is entirely up to you!