If the shells are not already cooked, you will want to break them up into smaller pieces, drizzle a little olive oil on them and roast them in a 350-degree oven until they become fragrant and just begin to brown. This may take about 30 minutes.
In a large stockpot, place shells, coarsely chopped onion, celery stalks, leek, and carrot. Cover all ingredients with enough water so the shells are completely submerged by 1 to 2 inches. Cook the stock on low for 3 to 4 hours. Strain stock, discard all solids. Return stock to a pan, and reduce by half by turning up the heat until the stock just begins to boil.
Place 2 tablespoons of butter in a 2-quart pot with the shallots, and celery. Saute until the shallots and celery become soft. Add 2 tablespoons of flour and cook until the roux becomes fragrant. Add seafood stock and sherry. Stir until the soup becomes thick. Add cream and heat through. If you desire a bisque that is smooth, process the soup with a food processor or a stick blender, then strain the soup with a fine sieve. Return soup to the pot. Add cooked crab if desired. Serve immediately.