William B. Hooper, 73, former general manager and secretary-treasurer of the Maryland and Virginia Milk Producers Association, died Tuesday at his home in Lusby, Md., after a heart attack.

He oversaw the general affairs of the huge and powerful milk marketing cooperative from 1956 until 1964.He had joined the association in 1935 as office manager, when it was still in its growing stages, and had helped it become one of the largest businesses in the Washington area.

During the 1950s, when he took over as general manager, the cooperative had nearly 2,000 members and marketed 90 percent of the milk sold in this area. It survived numerous antitrust actions over the years.

After leaving the milk producers group, Mr. Hooper was president of the Club Internationale travel division of the Diners Club for 10 years. Following his retirement in 1974, he moved to Lusby but continued as owner of the Birchmere Inc., a bluegrass music club in Arlington, which he had established in 1964.

Mr. Hooper was born in Baltimore. He became an accountant with the Baltimore and Ohio Railroad there in 1928 and worked briefly for the Federal Marketing Section of the Agriculture Department before joining the milk producers association.

He was a member of the American Management Association and the American Marketing Association. A Master Mason of Harmony Lodge No. 17, he was a Royal Arch Select Master of Adonevim Council and a Royal Arch Master of Columbia Chapter No. 1.

Survivors include his wife, the former Edith Powell, of Lusby; a daughter, Patricia A., of Arlington; two sons, William E., of Baltimore, and Michael P., of Dayton, Ohio; a sister, Gertrude Walsh of Baltimore, and six grandchildren.

The family suggests that expressions of sympathy be in the form of contributions to the American Heart Association.