When do you contact ATC when departing from a non-towered airport into class B controlled airspace?
This is the situation where the uncontrolled airport sits under the Class B shelf.
I'm assuming you're VFR.
You contact ATC before you enter the Class B air space.
If necessary, you orbit outside, but you don't enter until after you hear the magic phrase
"<your callsign>, cleared into the Class Bravo airspace" from ATC.
If it's a busy time and/or the weather is poor, you may NOT get that clearance.
See this blog for a more detailed explanation.
If you're flying IFR, the answer is the same except you would be in contact with ATC either before or right after take off. The Class B becomes more or less moot - they handle it for you.
I just want to note the reference for this rule - it's 14 CFR 91.131.
If the nontowered satellite airport is close to the the primary airport that the TRACON airspace serves, I'd try to call TRACON up on the ground before departing.
Another option is staying under the bravo shelf once in the air and then asking for the bravo clearance.
If that doesn't work, you could also try to file an IFR flight plan and get your clearance on the ground from FSS on the radio or via a phone call. Once you get into the air and into the bravo, cancel the IFR flight plan.