I have a short stay Bulgarian visa (Type C) that is valid from July 27th, 2015 to August 17th, 2015. The duration of stay on the visa is 6 days. Will it be legal to arrive on July 27th, 2015 and depart on August 2nd, 2015 i.e. does it count as a stay of six days or seven?
As @GayotFow already commented, that's seven days, not six. Both the day you enter and the day you leave do count in the total. Enforcement is primarily based on the date/stamps, not on a minute-by-minute count of the time spent.
If you find it difficult to compute the duration, you can use the calculator mentioned in How does the Schengen 90/180 rule work?. While, as of June 2015, Bulgaria still hasn't joined the Schengen area and cannot issue Schengen visas, it does apply the exact same rules.