A light neutral will match any dark trim. White may be too harsh against the trim, so try an off-white. Straw or flax are good options, too. As you move into the darker neutral hues, like taupe, you lessen the contrast with the trim but darken the room. Lighter neutrals will make the trim appear bolder. With a neutral, you face no color harmony issues, no matter what the trim hue is.
Take a light variant of the dark trim for a simple match that does not skimp on color. For instance, if the trim is dark blue, choose a sky blue or similar blue pastel. For a deep violet, lilac or light mauve are fine selections. Again, by using a variant, you have immediate color harmony. The contrast issue applies here as well. Darker variants present less contract with your trim but make the room less light.
Rather than using a direct color variant, you can use a color in a lighter shade with a matching color temperature, either cool or warm. For instance, if the trim is a rich tobacco color, use a warm color on the light side like pale pink. For a corresponding cooler match, if the trim is a dark slate green, a pale sea foam is appropriate.
Complements introduce strong contrast because, in color science, they are opposites. Pair a red against green, a yellow against purple or an orange against blue, and you have powerful color impact. Again, for the walls you likely want lighter complements, but if you want a strong decorative effect, you can use mid-range hues. A dark blue trim matched with melon is one example. For a similar impact against crimson, choose a grasshopper green with a breath of gray mixed in.