Personally, I rarely mix synth and sample melodies together. This means like, a full on 4-8 bar synth loop with a 4-8 bar sample loop. If I mix a synth with a sample, the synth is usually just an add on, with the sample being the main backbone of the song. OR, a lot of the time I have a sample for the verse and a synth for the chorus.
It's definitely hard to mix the two though. I'd recommend listening to Kanye and Drake for examples of doing it successfully. In general, use reverb. Level it similarly to the sample. EQ it. Make sure the notes are in key with the sample.