Rather than directly choosing melody notes based on the notes in your riff, it would be more common to consider what tonality (or tonalities) your riff could suggest, and then write a melody line that has the same tonality.
For example, a riff that goes A, B, C continuously could (depending on its phrasing) suggest the key of A minor, so you could take notes from the A minor scale as your starting point (though as Neil Meyer points out in his comment, that doesn't mean you're restricted to that set of notes!). Alternatively, you could work in a blues tonality rooted on A. Another possibility might be C major.
However, there's no one rule, and there are all sorts of possibilities. If the riff was slower, you could choose notes from G major over the A and B, and notes from C minor over the C. Or you could play a melody that sometimes followed the phrasing of the riff but a perfect fifth higher, creating a kind of 'oriental' sound... or just muck about and try things and see what sounds good. usually if you're composing, you have the time to come up with something interesting by trial and error!