In classical functional harmony, non-diatonic chords are usually diatonic to a related tonal center, so the answer is that it depends on what the local tonal center is. Normally, the ♭Ⅶ chord will be taken from the parallel minor or a related key. For example, it can be Ⅴ/♭Ⅲ, where ♭Ⅲ is the relative major of the parallel minor.
The first example that comes to mind, however, is the ♭Ⅶ in Begin the Beguine, which itself is the tonal center of the first phrase of the bridge: ⅱ/♭Ⅶ → Ⅴ7/♭Ⅶ → ♭Ⅶ. Overall, the bridge shifts the tonal center, roughly in the parallel minor, from ⅰ (the same as ⅱ/♭Ⅶ) to ♭Ⅶ to ♭Ⅵ to Ⅴ. These shifts are achieved by lowering the major third that ended the preceding phrase to the minor third:
- ⅰ (= ⅱ/♭Ⅶ) → Ⅴ7/♭Ⅶ → ♭Ⅶ
- ♭ⅶ (= ⅱ/♭Ⅵ) → Ⅴ7/♭Ⅵ → ♭Ⅵ7
The next chord is a diminished seventh achieved by raising the root of the preceding chord by a half step. This leads to ⅶ°7/Ⅴ and then to a period of alternation between various minor subdominant functions and the dominant, where the bridge ends. The last phrase definitively reestablishes the major key by starting with the tonic Ⅰ chord.