Preferably, you'd want to connect all your devices into your TV's HDMI ports, this eliminates the need to change input sources on your sound bar. However, if you are not getting surround sound from your Blu-Ray Player (5.1 if 7.1), then connecting the Blu-Ray Player into the sound bar is the way to go.
There are no preferable HDMI Ports for your Cable Box. Just connect it to any available ports on your TV, and then configure your video settings to your liking.
If your TV is not outputting surround sound when watching HD Content, then adding the Optical Cable will have a benefit on your audio. However, this applies to HD Content only, Standard Definition content will not have any noticeable benefit.
Overall, if your TV is able to output sound at (5.1 or 7.1) when watching Blu-Ray or HD Content, then connecting all your devices into the TV is the way to go. However, if your TV only outputs sound in stereo (2.1), then connecting your devices to your sound bar will be a huge benefit.
======QUESTION ABOUT ANYNET+=======
I'll be testing that tomorrow, I'll update as soon as I can if AnyNet+ would work when connected to an HDMI input on the sound bar.