There's a moment in Star Trek: The Next Generation, where the Captain is making a general announcement and the camera pans through the ship to show various crew members, and one of the listeners is a hairy legged guy in womens uniform. That's all we see of him, but I gather 'cross-dressing dude/guy' is fondly remembered. What's odd is that we don't see more of characters like him given the diversity of Human sexuality, and given that Star Trek avows a love of diversity which it represents with its IDIC logo.
The main SF work I can think of dealing with gender would be Ursula K Le Guin's The Left Hand Of Darkness, which looks at a society in which no one is male or female, but at certain times of the month becomes one or the other, for a short time. Which it will be is not pre-determined. One month they could be male, the next female. This means that a couple also doesn't know which of them might be the one to get pregnant until one of them does. It's really more an exploration of feminist issues than of general human sexuality.
There are probably plenty of other stories concerning science fictional genders. Possibly a lot of them designed more for titiallation than serious thought about the issues.
However, now I've read this blog article, and the comments on it, which raise the really basic question of why we think in terms of only male and female categoires when we know that humans are really much more complex and diverse than that. The blog's author suggests that it's not even a matter of being on a continuum between male and female, but of being part of a much more complex, 3D world than that. A point which causes one maths geek commenter to ask, "Only 3 dimensions?"
Check out Not Your Mom's Trans 101