Here's the complete passage:
2 Corinthians 5: NASB
1For we know that if the earthly tent which is our house is torn down, we have a building from God, a house not made with hands, eternal in the heavens.
{Paul shows here the distinction between our mortal bodies and our yet future resurrected incorruptible bodies....Resurrected bodies the subject and properly modified}
2For indeed in this house we groan, longing to be clothed with our dwelling from heaven, 3inasmuch as we, having put it on, will not be found naked.
{When we are resurrected we will not be 'naked' without a body. Still speaking of the Resurrection}
4For indeed while we are in this tent, we groan, being burdened, because we do not want to be unclothed but to be clothed, so that what is mortal will be swallowed up by life. 5Now He who prepared us for this very purpose is God, who gave to us the Spirit as a pledge.
{The desire is to have our mortal bodies swallowed up by life to be clothed with resurrected bodies. I would gather that is everyone's desire, to be the ones who are immediately translated and not die first. Paul leaves here hanging meaning does not address what unclothed means. Yet unclothed is an option}
6Therefore, being always of good courage, and knowing that while we are at home in the body we are absent from the Lord— 7for we walk by faith, not by sight— 8we are of good courage, I say, and prefer rather to be absent from the body and to be at home with the Lord. 9Therefore we also have as our ambition, whether at home or absent, to be pleasing to Him.
{Paul addresses here the status of the believer whose earthly tent has perished, yet has not received their building from God (verses 1-5). He describes this status as while we are at home in the mortal body we are absent from the Lord. Then addresses the converse of verse 6 in verse 8 by stating we should prefer to be absent from the mortal body and to be at home with the Lord.}
The resurrection is addressed in verses 1-4. The intermediary state in verses 6-9.
Confirmation in Philippians 1:
Philippians 1: NASB
21For to me, to live is Christ and to die is gain. 22But if I am to live on in the flesh, this will mean fruitful labor for me; and I do not know which to choose.
{Paul making the distinction of living on in the flesh (mortal body) is fruitful labor for him. He says to die is gain. He could be referencing here either the resurrection or immediate presence with the Lord or both.}
23But I am hard-pressed from both directions, having the desire to depart and be with Christ, for that is very much better;
{Here we get more information. He has a desire that if he dies to depart and be with Christ and that is much better. Makes no mention of the Resurrection here, it is about presence with Christ.}
24yet to remain on in the flesh is more necessary for your sake. 25Convinced of this, I know that I will remain and continue with you all for your progress and joy in the faith, 26so that your proud confidence in me may abound in Christ Jesus through my coming to you again.
{Paul referencing the resurrection here is categorically impossible. He makes the distinction that departing them (the Philippians) means he will be with Christ (verse 23) yet to remain with them is more necessary for them. If Paul is referencing the resurrection here, it would mean he is being resurrected and leaving the Philippians behind.}
The key teaching in both passages is the believer's presence with Christ. If a body is decaying in the grave then there is something of 'us' which is present with Christ. That is the apostolic teaching.