This is an extremely broad topic, so I'm going to try to distill it down to just a handful of points:
There are (basically) two ways of generating sounds electronically: sampling and synthesis. Confusingly, we tend to call all of this sound generation "synthesis", as you are generally working with a "synthesizer".
You will want to read Wikipedia - Synthesizer, but here are some cliff notes:
Sampling is when you literally record the sound of the instrument you want to play into a digital waveform (how all audio is stored digitally), and your software plays back the waveform (or sample), but tweaks it according to how you want it to be played back, either with pitch shifting, looping, or modulation. You can have as few as one sample for an entire digital instrument, or as many as multiple samples for every single note on the keyboard for different dynamic levels or qualities of attack. Nearly all digital pianos use high-quality samples to generate sound, and there are very expensive libraries of orchestral samples that one can purchase if they need to synthesize a full orchestra.
Synthesis: Sampling is technically one type of synthesis. Other types (rather than play back recordings of a particular sound) generate basic waveforms like a sine wave, square wave, and sawtooth wave, often at different frequencies, and add them together while passing them through various filters and other effects to result in a distinct waveform that represents a timbre, or quality of sound. When you are trying to replicate acoustic instruments this way, you call it "imitative synthesis". Usually, though, one would use this kind of synthesis to generate sounds that cannot be generated by an acoustic instrument. Sampling technology is far more effective at replicating acoustic sounds than imitative synthesis.
Based on your question, it sounds like you are trying to achieve imitative synthesis. I'm not sure what you mean by your A sounding "fake" -- if it's at 440Hz, it's just as real of an A as any other A, but chances are it just sounds like a sine wave.
For an extremely simple exercise for the reader, try synthesizing an "organ" sound by playing your 1 amplitude 440Hz sine wave and a .2 amplitude 660Hz sine wave at the same time. It's a long way from there to a piano. You'll want to look at the waveform for a single acoustic piano note (using a waveform editor like Audacity), compare it to what you're generating with your software, and then figure out how to best tweak your software to approach the acoustic piano waveform.
It would also be a good idea to become familiar with some real audio synthesis software first, like Reason, Csound, Max/MSP, or Pure Data. You'll also want to read up on the harmonic series.