For Libraries, navigate to the state and then to the Community Profile for the city or town of interest and then refer to the navigation elements in the upper-left labeled "Jump to...(on this page)". Follow the link for "Schools & Education". You'll find a link to the nearest libraries in that section.
For Historical Societies, navigate to the state and then to the Community Profile for the city or town of interest and then refer to the "Search the map for:" function on the lower-left underneath the map. Do a search for "Historical Society" (quotes are not necessary) and the nearest ones will be listed.