First of all, I do not think that there are keys that "do not work well together". There are just better or worse ways to make a transition from one key to another. Obviously, there are keys that are very remote from each other, but nevertheless, a good composer will be able to make a convincing transition. Of course, certain key changes occur much more often than others, especially changes between closely related keys. However, these more common key changes also have less potential to create an interesting effect.
Changing keys is called modulation, and in the Wikipedia article on modulation you'll find a lot of useful information, especially about traditional (i.e. classical) ways of modulation. I will mention a few tricks (some of which fall into the categories explained in the article) that are used in popular music, because I think that's what you're interested in:
- surprise: just go from one key to another without any preparation.
- re-interpretation of chords: a chord with a certain function can appear in a different (related) key with a different function, i.e. an A major chord is the IV chord in E major, and at the same time it is the V chord in D major (or minor). So you can use this chord to change between these keys.
- use the V chord or a ii-V progression approaching the new key: e.g. if you want to go (from any key) to C major, use a G7 chord, or a Dm7-G7 progression.
- change the quality of a diatonic chord, i.e. if it's major make it minor and vice versa. Then use this new chord as a diatonic chord of a new key. E.g. if you're in C major, then the vi chord is Am. Now change it to A, and use it as the IV chord of E major.
I think that these types of modulations cover a great deal of ways to change keys used in pop tunes.
Now for an example, as suggested in your question. If you want to modulate from C major to G minor you could use the third approach explained above, i.e. use a 2-5 progression approaching G minor:
some progression in C ... 2-5 to G minor some progression in Gm ...
||: C F | G7 C :|| C F | Am7(b5) D7 ||: Gm Eb | Bb F :||
| 2. / / / / and back to C
| Bb F G7 | C ||