AFAIK digital optical audio on most motherboards with integrated sound only do PCM 2.0 (stereo sound). You would need something like Dolby Digital Live (DDL) to upconvert stereo to 5.1. A previous post mentioned a 3D effect on their receiver, which does pretty much the same thing as DDL (except for media that has analog 5.1, which is mostly games). You would probably need a new sound card that has this feature to use this.
If you were to play a DVD on your PC, the audio from the DVD would passthrough to your receiver. If it's 5.1, you'll hear 5.1. This applies to any file you have that has Dolby or DTS audio (or any format your receiver can decode, it is not dependent on your PC).
You can visit this site to test out my last paragraph (use something like VLC to play these, also make sure in the audio menu you have it set to 5.1)
As far as gaming is concerned, a few games have a Dolby output option which will give you 5.1 hassle free (BioShock 1 for example). But most games don't have this feature, so you'll be stuck with stereo sound unless you were to use a 3D effect on your receiver or DDL. With DDL you'll get the proper positioning with surround, but the audio will be downsampled due to bandwidth restrictions over digital optical audio. FYI downsampling would depend on the source, older games may not need downsampling due to lower bitrates.
Hope this helps!