I spent around 5 years crippled by this very issue, to the point where I was so lonely I was terrified of any social contact, and close to not wanting to continue. It took just as long to 'recover' from this very real issue. You are in no way alone with this issue, and I think is really felt throughout the IT industry.
The way I am learning to overcome my loneliness and social anxiety issues, is be forcing myself to go out with people when I am invited, and to exercise (perhaps to the extreme) with cycling, climbing, swimming, running, etc.
Remember however that loneliness is not something that anyone else can solve other then yourself. You may need to change your situation, and surround yourself with people similar to yourself, and understanding kind people if possible.
As others have said loneliness is a problem of situation, and lack of contact with others. Your absolutely doing the right thing by reaching out and talking about it however!