The most comfortable way to sleep after shoulder surgery is usually in a recliner. The majority of my shoulder patients have found this to work the best.
If you do not have a recliner, my best recommendation for sleeping is to try to use several pillows to prop yourself up in bed. Put several under your back, as well as propping up your arm while it is in the sling. It obviously won't be as comfortable as if you hadn't had surgery, but it should help. If you are someone who has to sleep on your side, lay on your non-surgery side and then prop your surgery arm up with pillows - like you are hugging the pillows - my girlfriend had shoulder surgery in May, and she found this to be the most comfortable way to sleep.