While Homosexual Obsessive-Compulsive Disorder (HOCD) isn't a true medical diagnosis, it is a "theme" of an obsessive-compulsive disorder that is characterised by an unreasonable obsession with your own sexuality, namely whether you're actually a homosexual. The basis of the obsession being considered unreasonable is that it afflicts a person who is truly heterosexual, prompting a compulsion that often mitigates this fear. To cure this type of anxiety disorder, you'll often follow the same type of therapy as with any other obsessive-compulsive disorder.
The first step in treating HOCD is finding a trained medical professional who can treat your anxiety disorder. Cognitive-behavioural therapists are probably the best physicians to work with this type of condition, as they can properly discern whether you're suffering from obsessive-compulsive disorder, properly diagnosis the condition and put into place the proper techniques for treatment. So ask a trusted doctor for a recommendation of a cognitive-behavioural therapist.
When you start cognitive-behaviour therapy, you'll work with a therapist to discern exactly where the problem lies, creating a detailed list of symptoms associated with the condition and assessing the best approach and steps for treatment. After a solid assessment is made, you'll start with something called ERP therapy, which is a form of exposure and response prevention.
With this form of treatment, you go through a series of exposures that commonly trigger the fear centring on your obsession. Most of the time, the exposures start out rather mild, such as exposing you to homoerotic images, and progresses up to more significant exposures, like taking you to a gay bar. Each time you're exposed and the fear hits, your therapist can give you tools and techniques to better respond and cope with the obsession and thereby lessen the anxiety without needing to go through any compulsions.
Though this form of therapy is often beneficial, it takes a great deal of dedication from you, as you'll often receive "homework" to take with you that continually challenges you and your obsessions. What these assignments serve to do is expose you to the triggers between sessions that may present themselves during your daily life. You'll then use the tools and techniques provided to you by the "supervised exposures" to prevent the negative response and lessen the anxiety on your own. Without this part of the process, many people aren't able to "cure" the HOCD.
For most people, HOCD is often treated fully with ERP therapy. However, some people may need to use medications to "cure" their condition. Antidepressants, like clomipramine, fluoxetine or sertraline, are the most common, but your doctor may place you on a different medication. What these types of medications serve to do is balance out the serotonin levels within the brain so you no longer obsess.