You will plug your laptop to both the receiver (optical, for audio) and TV (HDMI, video). From your laptop' sound settings, you will chose your sound device (laptop' internal speakers, received thru optical, or TV thru HDMI).
Your other option is to use "HDMI Audio Extractor" - a device which sits on the HDMI cable from laptop to the TV, and extracts audio signal over optical to the receiver.