Selecting and removing particular objects
This should do the trick, first iterate through everything in your scene, next check if it is as mesh and check if it is a cube (by name using the first 4 chars), then remove it. Also, make sure you are in object mode when running the script.

import bpy

scene = bpy.context.scene

for ob in scene.objects:
    if ob.type == 'MESH' and ob.name.startswith("Cube"):
        ob.select = True
    else: 
        ob.select = False

bpy.ops.object.delete()


Unlinking an object from a scene does not remove it entirely.



Condensed version of the same script thanks to CoDEmanX.

import bpy    
for ob in bpy.context.scene.objects:
    ob.select = ob.type == 'MESH' and ob.name.startswith("Cube")
bpy.ops.object.delete()