My understanding is (though I've never done it; I play around in the NE corner of the SFRA) you have two choices. If you're going in and out to the NW (ie only in the little triangular Leesburg maneuvering area), you can use the simplified "ingress" and "egress" squawk codes (1227 and 1226), and not talk to ATC. Just make regular calls on Leesburg's CTAF.
If it's not convenient for you to be going directly in from the northwest and back out to the northwest, just do like a normal SFRA flight: file a flight plan from an entry gate to JYO and/or from JYO to an exit gate, contact ATC before entering the SFRA and/or taking off at JYO and get your transponder code from them.
Either way, squawk your code all the way to the ground, and before taking off. And if any of this disagrees with the course, do what the course says