I was exactly like that up until 4-5 years ago. Sex helped me start to get social. It was my first chance at meeting people.
I dont know how it is for you, but for me it was (and I still carry that till today a bit) the thought that I wasnt interesting enough that made me shy away from social interactions of any kind. Slowly but surely I realised that I am definitely not less interesting or fun than most other people.
Sex won't really be very much help for me. I don't really date or have random sex either. The opportunity really doesn't present it's self, not that I actively look very often, I guess the best way to describe me is uncomfortable with myself as a whole. I don't really see myself as attractive. I tried to update my profile pic but it didn't work for some reason, my pic is getting a little outdated now and I have changed some, but even then I wasn't happy with myself. I guess you could chalk it up to poor life choices on my part. I've made my fair share of bad decisions in my 35 years, and I pay the price for them every day. I don't really see me getting into a sexual relationship anytime soon. I just look in the mirror and think, well, I wouldn't want me so why would someone else. I am glad to hear that it worked for you though. Some say that the right person is out there for everyone, but for me, I just see my hand in my future