If you are using a solid body: For feedback at a specific pitch, use a parametric E.Q. (like what's built into a multi-effects unit), boost the midrange section up a bunch, then sweep thru the frequency parameter while playing your note until you find the frequency that will produce feedback. You will need to have the amp cranked at least a little bit. In general to control feedback the amp needs to be cranked to that "magic" volume where when you move close to the amp it will feed back and a couple feet away, it won't. Another way to sustain a particular note is to pluck it, and then hold the headstock of the guitar against the speaker board of your amp. Turning up the midrange control of your amp will help a lot with any of the methods above. Compressing your signal in front of the amp will probably help a little too.
If you are using an acoustic electric, good luck, your feedback freqencies are already predetermined by the construction of the guitar.