If you had cancer, what would you tell your friends and family? Probably that you had cancer.
Why is telling them you have OCD any different? If OCD is a serious problem in your life, then it will be helpful for you to have the support of people who love and care for you.
Talk to them about your fears, and let them know how they can help you because most of them will offer to anyway. Even if it is just having them check in on you, let others know what they can do to help.
There is an unfortunate stigma about mental illness, even though there are actually more people with anxiety than there are with cancer, we still think we need to hide the anxiety. The more you are open about your difficulties with the people you trust, the more you will influence them to be open about mental disorders.
That influence will grow exponentially over time, and hopefully there will be a day when people will not be ashamed to say they have a problem, no matter what it is.