Apple CEO Tim Cook's announcement that he's gay is "extraordinarily important" in the effort to break down prejudices and stereotypes, said former Rep. Barney Frank, who served decades in Congress as one of the most prominently openly gay politicians.

Lesbian, gay, bisexual, and transgendered people just want to be treated the same under the law, Frank told CNBC on Thursday, shortly after Cook's revelation in a BloombergBusinessweek op-ed. The Massachusetts Democrat said Cook's courage will help others who may be reticent or struggling whether to publicly discuss their sexual orientation.