I have no problem with being a little rude about this subject outside work but I can't think of a PC answers if this subject came up for discussion in the office.
I'd say something along the lines of "why? Does it matter?" and leave the ball hanging in their court. I doubt anyone sensible will consider the response to this question as something they can reasonably answer positively. And once they admit it doesn't matter, you've already moved the conversation on, away from this non-constructive subject.
In a professional setting, asking unprompted about someone's sexual orientation is pretty much always inappropriate. If you don't want to be questioned, then some variation of "it's not an appropriate subject for the office" should suffice. Don't make it about yourself and why you don't want to answer; the questioner would be equally wrong asking anyone.
I agree with Julia Hayward that it's inappropriate to ask at work. I'd suggest a different response, though - "it's not an appropriate subject" may come across as a bit unfriendly.
I'd go with some variation of "Why do you ask?" The response will probably be something along the lines of "Oh, I was just wondering." At that point, you respond only to this last sentence, with e.g. "Oh, OK then" - and then you change the subject. Or you could prolong it a bit with "What made you wonder?" - and whatever they say, you can still respond with "Oh, OK then" and a change of subject.
In other words - turn the question around so that they have to explain why they would even ask that question, and then change the subject.
If they persist after this, that's the time to respond with "No, I didn't answer, because I don't think it's an appropriate subject for the office". At that point their insistence is already well past the point of rudeness.
Asking someones sexual orientation is inappropriate in a work context, because it is irrelevant for the job. There is only one industry where asking about someones sexual orientation is work-related, and that is the adult entertainment and sex industry.
And even in that context it should be appropriate to answer questions about your sexual orientation with "I feel [comfortable|not comfortable] to work with [male|female|transexual] [performers|customers|content]" without revealing your actual sexual preference you have in a private context.
"I'll give you the short answer: the company hires without regard to sexual orientation. If you can't perform your job without knowing my sexual orientation, then you are working in the wrong place"