As opposed to something like the Pyramids, where we discovered a lot of these things that had been preserved for other reasons, I'm asking about deliberate attempts by a society to leave something behind so as to be understood by future cultures/civilizations (or in the future of their own culture).
I'm sure you're also interested in physical time capsules, inscriptions on monuments, for example, but of course the beginnings of the genre of history writing itself was intended to preserve knowledge. For example, this consideration of a future viewpoint is shown in Book 1 of Thucydides' History of the Peloponnesian War, where he anticipated that future archeologists might be examining Greece, and that the information they got purely from that physical record wouldn't complete:
“…[if] Sparta were to become deserted and only the temples and foundations of buildings remained, I think that future generations would, as time passed, find it very difficult to believe that the place had really been as powerful as it was represented to be. Yet the Spartans occupy two-fifths of the Peloponnese and stand at the head not only of the whole Peloponnese itself but also of numerous allies beyond its frontiers. Since, however, the city is not regularly planned and contains no temples or monuments of great magnificence, but is simply a collection of villages, in the ancient Hellenic way, its appearance would not come up to expectation. If, on the other hand, the same thing were to happen to Athens, one would conjecture from what met the eye that the city had been twice as powerful as in fact it is.” (1.10.2)
And of course Herodotus' Histories starts,
"This is the display of the inquiry of Herodotus of Halicarnassus, so that things done by man may not be forgotten in time, and that great and marvelous deeds, some displayed by the Hellenes, some by the barbarians, not lose their glory, including among others what was the cause of their waging war on each other."
Some inscriptions, mostly on tombs are adressed to future visitors, cursing those who come to plunder it and blessing those who visit the dead. Another exemple that look like what you are searching are mesopotamian foundation deposits. Obviously they are designed for the gods, but they contains objects or tablets hidden in the (ancient level of) the ground, preserving it almost forever (until the rise of mesopotamian archaeology).
Books? I mean Horace himself mentions in one of his poems that his poetry will be read a thousand years after his death. And he was right.