In 1 Corinthians 2:9, Paul says, "It is written," and then proceeds to quote a passage that doesn't exist verbatim in the Old Testament:
But, as it is written,
“What no eye has seen, nor ear heard,
nor the heart of man imagined,
what God has prepared for those who love him”— (1 Cor. 2:9)
What exactly is he quoting?
Most commentators rightly observe that Paul's language sounds most similar to a combination of Isaiah 64:4 (“From of old no one has heard or perceived by the ear, no eye has seen a God besides you, who acts for those who wait for him”; my emphasis) and 65:17 (“For behold, I create new heavens and a new earth, and the former things shall not be remembered or come into mind”).
While this is an accurate observation true, it seems to me that Paul has a broader biblical theme in mind.
Thematically, Paul's reference to the Old Testament sounds closer to other passages that combine the ideas of blind eyes, deaf ears, and dull hearts with the idea of God’s veiling of his revelation. There are at least four important passages along these lines.
Blind, Deaf, and Dull-Hearted Israelites
First, Moses declares to the Israelites, “But to this day the LORD has not given you a heart to understand or eyes to see or ears to hear" (Deut. 29:4). After seeing the great wonders that God did for his people in Egypt and through the wilderness, God's people still don't believe (Deut. 29:2–3, 5–9)! They did not perceive by faith what God was really doing in those great works.
So, Moses urges the Israelites to dedicate themselves to the covenant God has made with them (Deut. 29:10–28). In this vein, he declares that, "The secret things belong to the LORD our God, but the things that are revealed belong to us and to our children forever, that we may do all the words of this law” (Deut. 29:29).
Give yourselves to what God has revealed, and leave God's secret wisdom to God!
Blind, Deaf, Dull-Hearted, and Unrepentant Israelites
The second example is in Isaiah: “And he said, ‘Go, and say to this people: 'Keep on hearing, but do not understand; keep on seeing, but do not perceive.' Make the heart of this people dull, and their ears heavy, and blind their eyes; lest they see with their eyes, and hear with their ears; and understand with their hearts, and turn and be healed’” (Isa. 6:9–10).
In this case, it is not the secret things that are hidden from Israel, but the revealed things. Isaiah's ministry was to keep on preaching to them, and in spite of his faithfulness, they would still never believe!
Blind, Deaf, Dull-Hearted, and Rebellious Israelites
The third example is in Jeremiah: “Hear this, O foolish and senseless people, who have eyes, but see not, who have ears, but hear not…But this people has a stubborn and rebellious heart; they have turned aside and gone away” (Jer. 5:21, 23).
Then, later in that passage he explains why God's revelation is hidden from his people: “An appalling and horrible thing has happened in the land: the prophets prophesy falsely, and the priests rule at their direction; my people love to have it so, but what will you do when the end comes?” (Jer. 5:30–31).
This is yet one step further in Israel's rebellion. It is not merely that they are not listening, but that they eagerly give themselves to false revelation. Thus, God's revelation is hidden from them by their wicked rejection of it.
Hidden, Concealed Wisdom in Job
The final passage is not so much about the sinful blindness, deafness, and dullness of God's people. Rather, in the theological climax of the book of Job, we read about God's hidden wisdom: "But where shall wisdom be found? And where is the place of understanding" (Job 28:12).
Along the way, Job points out that eyes and ears cannot discover wisdom, since it is concealed from all living creatures:
 “From where, then, does wisdom come?
And where is the place of understanding?
 It is hidden from the eyes of all living
and concealed from the birds of the air.
 Abaddon and Death say,
‘We have heard a rumor of it with our ears.’ (Job 28:20–22)
Where this passage gets particularly relevant is in in the closing lines of the chapter. There, Job explains that only God knows where wisdom is, because he established wisdom at creation:
 “God understands the way to it,
and he knows its place.
 For he looks to the ends of the earth
and sees everything under the heavens.
 When he gave to the wind its weight
and apportioned the waters by measure,
 when he made a decree for the rain
and a way for the lightning of the thunder,
 then he saw it and declared it;
he established it, and searched it out.
 And he said to man,
‘Behold, the fear of the Lord, that is wisdom,
and to turn away from evil is understanding.’” (Job 28:23–28)
Of course, this passage (similarly to Proverbs 8) is written about Christ, who is the Wisdom of God (1 Cor. 1:24, 30). Nevertheless, as John Owen so helpfully notes in his book, The Person of Christ, these Old Testament references to Christ as the Wisdom of God do not refer to the Son according to his divine nature.
Rather, they refer to the work that Christ would accomplish as mediator through his incarnation, life, death, resurrection, ascension, and return. As Owen points out, Christ is the foundation and focal point of all God's wisdom that God predestined before time and established at creation.
Concealed Wisdom in 1 Corinthians 2
This is the theme at the heart of 1 Corinthians 2 in the verses leading up to Paul's quotation:
 Yet among the mature we do impart wisdom, although it is not a wisdom of this age or of the rulers of this age, who are doomed to pass away.  But we impart a secret and hidden wisdom of God, which God decreed before the ages for our glory. (More literally: "But we speak God’s wisdom in a mystery, which [wisdom] is hidden, which [wisdom] God predestined before the ages, unto our glory." - my translation)  None of the rulers of this age understood this, for if they had, they would not have crucified the Lord of glory. (1 Cor. 2:6–8)
In the mystery of his hidden wisdom, God predestined to send Christ into the world from before the ages (1 Cor. 2:7). Therefore, the glorious wisdom of God revealed in Christ is something no eye has seen, no ear heard, and no heart conceived. In some cases (especially Israel's!), this inability to perceive God's wisdom led to sin, exile, and even the horror of crucifying the Lord of glory.
I used to read 1 Corinthians 2:9 as a reference to the blessings God has prepared for us in glory. I think that's still part of it, but I think that what Paul is talking about when he refers to what no eye has seen, nor ear heard, nor heart conceived is Christ crucified, revealed in the fullness of time as the grand design of God's wisdom, hidden in a mystery from before the ages began.
It has long been my practice to pray before every sermon that God would give us eyes to see, ears to hear, and hearts to understand all that is contained in the gospel of Jesus. We must not go beyond what is written, but rather go as deeply as we can into the God's hidden wisdom which has been revealed in the Scriptures by Christ. Working through the Old Testament background behind Paul's use of that language sharpens my understanding of what I'm praying there.