In a large, heavy-bottomed pot, melt butter over medium heat.
Add diced onions and cook for 5 - 6 minutes until they begin to soften.
Add diced celery and cook for an additional 2 - 3 minutes.
Sprinkle flour over sautéed vegetables and stir to coat. Add salt, pepper and Old Bay, then add stock and stir to combine.
Add reserved corn cobs, lower the heat and cover. Simmer for 25 - 30 minutes on medium-low heat.
After 30 minutes, remove corn cobs carefully with kitchen tongs and discard.
Increase heat back to medium. Add potatoes to the chowder and simmer for 8 - 10 minutes, or until potatoes begin to soften.
Add fresh corn and cook an additional 3 minutes.
Remove from heat, stir in heavy cream and crabmeat.
Garnish with chopped chives, if desired.