Psalm 32 speaks of "..acknowledge and confess sin to you (ie God)" 1 john 1:9 "If we confess our sins, he is faithful and just and will forgive us our sins and purify us from all unrighteousness" .....I am sure there are more but that is all about confession/repentance to God himself (which I have done - my last and what will be my final affair was about 6 years ago). The only thing I can find for confessing to others is James 5:16 "Therefore confess your sins to each other and pray for each other so that you may be healed. The prayer of a righteous person is powerful and effective" or Matthew 18:15-20
""[15] If your brother sins against you, go and show him his fault, just between the two of you. If he listens to you, you have won your brother over. [16] But if he will not listen, take one or two others along, so that 'every matter may be established by the testimony of two or three witnesses.' [17] If he refuses to listen to them, tell it to the church; and if he refuses to listen even to the church, treat him as you would a pagan or a tax collector. [18] "I tell you the truth, whatever you bind on earth will be bound in heaven, and whatever you loose on earth will be loosed in heaven. [19] "Again, I tell you that if two of you on earth agree about anything you ask for, it will be done for you by my Father in heaven. [20] For where two or three come together in my name, there am I with them.""
I can't find anything about having to tell everything to your spouse in order to be forgiven and I am sure God is not "held to ransom" in his ability to forgive based on another human being forgiving first. HOWEVER based on what my pastor said I do wonder if God somehow has it as a principle that first the spouse must forgive before he will.