Revlon Inc., the Fifth Avenue-based cosmetics and health care company that has been fighting Pantry Pride Inc.'s hostile takeover bid, said today it has agreed to a be acquired by certain members of management and New York investors for $1.7 billion in a leveraged buyout.

Revlon stockholders would receive about $56 a share in exchange for a stock that has traded as low as $32.50 in the past year. Members of management and outside investors would acquire Revlon with a combination of borrowed money; an investment of $445 million by Forstmann Little & Co., a firm specializing in buyouts, and proceeds from the sale of certain Revlon subsidiaries.

The total value of the transaction, including the purchase of Revlon's shares and the debt to be assumed or refinanced, is about $3 billion, Revlon Chairman Michel C. Bergerac said today. Sources said this would make this the largest leveraged buyout in history.

"I think this is a fair price," said Merrill Lynch analyst Deepak Raj. "It is a generous price for Revlon," said Dean Witter analyst Joseph H. Kozloff.

"The board believes this is an outstanding transaction and obviously in the best interest of the company, its employes and our stockholders," Revlon Chairman Bergerac said.

Under terms of the agreement, a group including Forstmann Little and Bergerac would purchase most of Revlon's health care business while a separate investor group led by Adler & Shaykin, a New York investment firm, has agreed to purchase Revlon's worldwide beauty products business for about $900 million. The Adler & Shaykin buyout group includes members of Revlon beauty products management.

The health care business includes the National Health Laboratories clinical diagnostic lab division, which has a major facility in Vienna, Va. It also includes one of the nation's largest vision care businesses. Revlon's Norcliff Thayer and Reheis Chemical businesses, marketers of well known over-the-counter products including Tums, would be sold to American Home Products Corp. immediately after the acqusition of Revlon by Forstmann Little.

The sale of the beauty products business to Adler & Shaykin is expected to be completed prior to the acquisition of Revlon by Forstmann Little and is not subject to shareholder approval, Revlon said. The sale of this business and certain other agreements between Forstmann Little and the other investors could make it difficult for Pantry Pride or other rival bidders to derail this transaction with competing buyout bids.

Pantry Pride, a Fort Lauderdale, Fla., operator of supermarkets and other stores raised its bid for Revlon from $50 to $53 a share this week after learning that Revlon was considering a leveraged buyout.

Last year, Revlon's health care business had $1.3 billion in revenue and the beauty products business had $1.1 billion. The company's overall revenue and net income for 1982, 1983 and 1984 has been about $2.4 billion and $112 million, respectively, each year.

Revlon and Forstmann Little said the merger agreement provides that if the deal is not consummated for any reason other than a breach by Forstmann Little, Revlon will pay Forstmann Little a $25 million fee. Both the Forstmann Little acquisition of Revlon and Adler & Shaykin's acquisition of the beauty products business are fully financed and not subject to completion of financing.

Revlon said it plans to submit the deal to Revlon shareholders at a special meeting in late November.

"This company has been the leader in cosmetics sold through traditional retail outlets," said Bear, Stearns analyst James Waggoner. "Bergerac came in with a mandate to build the health care business and that was what he was interested in. He built a health care business via acquisition using the cash flow from the cosmetics. Using all that cash to make acquisitions caught up with them and they have been losing their cosmetics franchise."