From 13th to 15th century, Kastamonu was the capital of Candaroğlu, a Turkic principality ruled what is now Western Karadeniz (or, as known in ancient times, Paphlagonia), which, in 1461, fell to Ottomans, which started as another small Turkic principality and took control of others one by one. Kastamonu continued to be one of the important centres of Asian Turkey, in addition to being the capital of a large province extending all the way from Istanbul's Asian suburbs to Sinop during Ottoman period.
The city lies elongatedly along the banks of a river. The southern part forms the historic core (although traditional cityscape is pierced by modern concrete constructions at parts), while the northern half of the city is built completely within the last decades. All around this linear city is sparsely-wooded higher mountains.
A ride from Istanbul normally takes 8 to 8½ hours from the main otogar in European Side, and an hour less than that from the smaller otogar in Asian Side, including a break around the mid-way. However, there are some reports that some local (i.e., Kastamonu-based) bus companies took the same route in 12 hours, as they tend to stop at every and each town along the way. Metro Turizm and Ulusoy both are reliable nation-wide bus companies with quite frequent connections between Istanbul and Kastamonu. The price for a one-way ticket on this route ranges from 40 to 45 TL.
From/To Ankara, a bus ride—which crosses the beautiful Ilgaz Mountains—takes around 4½ hours, including a stop about an hour south of Kastamonu, costing 25 TL pp one-way. Metro Turizm offers connections on this route, too.
Kastamonu's otogar lies at the northern outskirts of the city. Buses from Istanbul cross the city from one end to another before arriving at the otogar, so it's possible to get off at the city centre without the need to get to the otogar first. If you somehow happen to find yourself at the otogar, just get to the bus stop on the road bordering the otogar, from which you can get into an urban bus to the city centre for 1.25 TL. They have about 5-min intervals and take about 15 minutes to get to the city centre.
Kastamonu lies in a somewhat remote location, off the major highways traversing the country.
From Istanbul, the easiest route would be to take the motorway/toll-road O-4/E80 eastwards until Gerede, then hitting northwards D755 30 km east of Gerede. D755 will take you to Karabük, from where you should take eastwards D030 to Kastamonu, via Araç.
From Ankara, the easiest route is taking eastwards D140 to Kalecik via Akyurt first. From Kalecik, hit northwards D765, which will take you to Kastamonu via Çankırı and Ilgaz.