It's not a direct comparison, but consider the handling of Ebola, where due to simple epidemiological interventions spread has basically been localized and stopped and no outbreak has killed more than 1000 people. Or consider the regular emergence of new flu strains which are far more contagious and are quickly and effectively contained. Though that comparison isn't great because we have a lot of knowledge when it comes to dealing with the flu.
My impression is (and I have not studied this) the failure in the HIV epidemic (pandemic?) wasn't a failure to develop drugs, it was a failure to perform basic epidemiological interventions to learn about and slow the progress of the disease.