To design a synthesizer, you have to think about a lot of things: what kind of sounds you want your synth to produce, what sound generation/synthesis method will be best for the sounds you want, what features it will need, what kind of interface you want to present to the user, and how the synth will respond to MIDI input.
In the Max Cookbook you can find quite a lot of examples demonstrating different aspects of building a synthesizer in MSP. They're pretty basic, and you can surely improve on them, but let's take a look at what's there.
There's an example of an "Overly simple MIDI synth", which is, as the title says, too simplified to be considered good, but it introduces some really basic ideas. It gets incoming MIDI note messages, and uses the key-number and velocity bytes to affect the pitch and loudness of the sound. Download the patch and try to understand the limitations the text is referring to as well as the suggestions on some of the ways in which this overly simple example could be improved.