The only way to break the cycle (and I apologize if this sounds harsh, but it's really the only way) is to just give yourself a swift kick in the pants and fucking DO something about it, and I don't mean posting on HN about how lonely you are. You have to actually GO somewhere where there are people and INTERACT with them in a positive way. Smile. Introduce yourself. Take interest in them. Listen. It hardly matters where you go or what you do. Just pick a random meetup near you and go. Or volunteer somewhere. Or just go to a random homeless person and offer to buy them a meal. The key is to project a positive attitude. This will be exceptionally difficult at first because every neuron in your brain is telling you that YOU are the one who needs to be listened to, the world has abandoned YOU, it's all about YOU. Well, guess what: you are not the only one who feels that way. EVERYONE feels that way at one time or another. You have to force yourself past those feelings and smile even though it's the most unnatural thing in the world for you to do right now. It feels like a lie.
But trust me, this feeling will be temporary. It might take more than one session, but eventually the mere act of smiling and listening to people will make them want to interact with you, and THAT will make the depression and the loneliness go away. And after a while it will start to work even when you are alone!
One disclaimer: depression can be very serious. It can be so serious that it does not respond to this kind of self-help. If you try this and it doesn't work, get counseling. There are professionals out there who can help. But whatever you do, don't succumb to the temptation to numb the pain by inaction. You can't get yourself out of a hole by curling up into a ball.