If all you need is a PWM output on pin 11, analogWrite will handle all the low level configuration for you. The first argument to analogWrite is the port pin and the second argument is the duty cycle (range 0 to 255). That's all there is to it.
The analogRead function returns values in the range 0 to 1023 so in order to pass this to analogWrite, you can divide the value by 4 to get it into the 0 to 255 range.
Your code should then look something like this:
byte potPin = 5;
byte ledPin = 11;
void setup()
{
pinMode(ledPin, OUTPUT); // sets the pin as output
}
void loop()
{
byte val = analogRead(potPin) / 4; // read the value from the sensor
analogWrite(ledPin, val); // Start PWM on LED pin with pulse width from potPin
}