Depression and anxiety often go together. For example, if someone has an anxiety disorder such as social anxiety, panic disorder or obsessive-compulsive disorder and has not received treatment and relief, feelings of hopelessness are common as the disorders take over more and more of one's functioning. These hopeless, helpless feelings are the pathway to depression. Fortunately anxiety is very treatable and so a positive prognosis is very likely.
In terms of depression turning into anxiety, what can happen for people who are depressed is that they may also have symptoms of anxiety: worrying, for example, if people will notice that they are depressed, that they aren't participating in conversations. These fears can lead to anticipatory anxiety about going places and can in turn feed the depression as now both anxiety and depression conspire to keep you away from activities and life. Once again, fortunately there are very powerful, effective treatments for depression and anxiety, so if you or someone you know is struggling with these conditions, please seek out help. It can make a world of difference.