Yup. I tried that too. What I found particularly interesting was that the optical cable coming out of the PC would support 5.1, but only for one application, Windows Media Center.
That port is not an audio interface, but a digital interface that happens to support
stereo PCM audio up to about "DVD quality" as one of its functions. If you want it to transport anything beyond that, you need to encode it yourself and push it through that port in "passthrough" mode. One of the better known encodings happens to be a DTS format that does some (lossy) compression to squeeze multi-channel audio in there, but that format is license encrusted to hell and back.
So effectively you can use the port to output audio that you already have in an appropriate formate, e.g., special audio tracks on DVD or BD, or from an application that has a licensed (or illegal) encoder.
(edit) And while I'm at it, I might as well keep on ranting. I don't really understand why everything still insists on using the optical interface instead of coaxial. The consumer version of the optical variant requires rather expensive hardware and non-ubiquitous cables and is severely limited compared to the coaxial interface that supports way higher signal rates at a way lower price. The only remotely valid argument for it is electrical isolation, but even that can be realised below the cost of a single TOSlink transmitter.