There's a whole lot of settings to adjust for this to work nicely.
Firstly the TV has to be switched to "PC mode" if it has one so it turns off scaling and other "enhancements" that are trying to make poor broadcast images look sharper. Then the computer needs to be set to output the correct resolution.