The way I understand it (from the outside as I don't have OCD) is that a lot of people with OCD feel trapped by their anxiety and rituals. Feeling trapped certainly can lead to depression.
A lot of people I know with depression may have obsessive traits, ruminating certainly goes hand in hand with depression.
Best of luck as you look for a way forward with your issues.